################################
#    Ctp debug message class   #
################################
class SerialMessage:
  def __init__(self, msg):
    buf = msg.split(',')
    self.serverTimeString = buf[0]
    self.serverSeq = int(buf[1])
    self.type  = buf[10]
    self.byte1 = int(buf[11])
    self.byte2 = int(buf[12])
    self.byte3 = int(buf[13])
    self.byte4 = int(buf[14])
    self.byte5 = int(buf[15])
    self.byte6 = int(buf[16])
    self.serverTime = int(buf[17])
    self.localSeq = int(buf[18])
  def getTime(self):
    return self.serverTime
  def getInt1(self):
    return (self.byte1 << 8) | self.byte2
  def getInt2(self):
    return (self.byte3 << 8) | self.byte4
  def getInt3(self):
    return (self.byte5 << 8) | self.byte6
  def getSeq(self):
    return (self.byte1 << 8) | self.byte2
  def getOrigin(self):
    return (self.byte3 << 8) | self.byte4
  def getDest(self):
    return (self.byte5 << 8) | self.byte6
